package com.qf.pojo;


import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.util.StringUtils;

import java.sql.SQLOutput;
import java.util.Date;

public class Books implements CheckNull {

  private long bookid;
  private String bookname;//书名
  private long categoryid;//属于那个分类
  private long bookstatus;//书的状态  0为连载1 为完结
  private long authorid;//作者ID
  private double booktotalstars;// 总共被评价的星数
  @JsonIgnore
  private long booktotalstartimes;// 总共被评价的次数
  @JsonIgnore
  private double bookaveragestar;//当前星级
  private String bookdescription;//图书简介
  @JsonIgnore
  private Date shelftime;//上架时间
  @JsonIgnore
  private long readernum;//阅读数量
  @JsonIgnore
  private long favnum;//收藏数量
  @JsonIgnore
  private long clicksnum;//点击数量
  private long datastatus;//数据状态 0 正常   1禁用
  private String bookpicurl;//图书地址

  private Categories categories;
  private Authors authors;

  public void setAuthors(Authors authors) {
    this.authors = authors;
  }

  @Override
  public boolean isNull() {
    return StringUtils.isEmpty(bookname)&&StringUtils.isEmpty(categoryid)&&StringUtils.isEmpty(authorid);
  }

  public Categories getCategories() {
    return categories;
  }

  public void setCategories(Categories categories) {
    this.categories = categories;
  }

  public long getBookid() {
    return bookid;
  }

  public void setBookid(long bookid) {
    this.bookid = bookid;
  }


  public String getBookname() {
    return bookname;
  }

  public void setBookname(String bookname) {
    this.bookname = bookname;
  }


  public long getCategoryid() {
    return categoryid;
  }

  public void setCategoryid(long categoryid) {
    this.categoryid = categoryid;
  }


  public long getBookstatus() {
    return bookstatus;
  }

  public void setBookstatus(long bookstatus) {
    this.bookstatus = bookstatus;
  }


  public long getAuthorid() {
    return authorid;
  }

  public void setAuthorid(long authorid) {
    this.authorid = authorid;
  }


  public double getBooktotalstars() {
    return booktotalstars;
  }

  public void setBooktotalstars(double booktotalstars) {
    this.booktotalstars = booktotalstars;
  }


  public long getBooktotalstartimes() {
    return booktotalstartimes;
  }

  public void setBooktotalstartimes(long booktotalstartimes) {
    this.booktotalstartimes = booktotalstartimes;
  }


  public double getBookaveragestar() {
    return bookaveragestar;
  }

  public void setBookaveragestar(double bookaveragestar) {
    this.bookaveragestar = bookaveragestar;
  }


  public String getBookdescription() {
    return bookdescription;
  }

  public void setBookdescription(String bookdescription) {
    this.bookdescription = bookdescription;
  }


  public Date getShelftime() {
    return shelftime;
  }

  public void setShelftime(Date shelftime) {
    this.shelftime = shelftime;
  }

  public long getReadernum() {
    return readernum;
  }

  public void setReadernum(long readernum) {
    this.readernum = readernum;
  }


  public long getFavnum() {
    return favnum;
  }

  public void setFavnum(long favnum) {
    this.favnum = favnum;
  }


  public long getClicksnum() {
    return clicksnum;
  }

  public void setClicksnum(long clicksnum) {
    this.clicksnum = clicksnum;
  }


  public long getDatastatus() {
    return datastatus;
  }

  public void setDatastatus(long datastatus) {
    this.datastatus = datastatus;
  }


  public String getBookpicurl() {
    return bookpicurl;
  }

  public void setBookpicurl(String bookpicurl) {
    this.bookpicurl = bookpicurl;
  }

  @Override
  public String toString() {
    return "Books{" +
            "bookid=" + bookid +
            ", bookname='" + bookname + '\'' +
            ", categoryid=" + categoryid +
            ", bookstatus=" + bookstatus +
            ", authorid=" + authorid +
            ", booktotalstars=" + booktotalstars +
            ", booktotalstartimes=" + booktotalstartimes +
            ", bookaveragestar=" + bookaveragestar +
            ", bookdescription='" + bookdescription + '\'' +
            ", shelftime=" + shelftime +
            ", readernum=" + readernum +
            ", favnum=" + favnum +
            ", clicksnum=" + clicksnum +
            ", datastatus=" + datastatus +
            ", bookpicurl='" + bookpicurl + '\'' +
            '}';
  }
}
